import React,{Component,PropTypes} from 'react'
import {Router,Route,IndexRoute,hashHistory} from 'react-router'

import '../less/style.less'


import Home from '../view/home/home'
import Details from  '../view/details/details'

/*我的*/
import My from '../view/my/my'
import MyAccount from  '../view/my/myAccount/myAccount'
import ShoppingAddress from '../view/my/myAccount/shoppingAddress/shoppingAddress'
import AddAddress from '../view/my/myAccount/shoppingAddress/addAddress'
import EditAddress from '../view/my/myAccount/shoppingAddress/editAddress'

import MyConcern from  '../view/my/myConcern/myConcern'

import MyCollect from '../view/my/myCollect/myCollect'

import MyOrder from '../view/my/myOrder/myOrder'
import OrderDetail from '../view/my/myOrder/orderDetail'

import MyWallet from '../view/my/myWallet/myWallet'
import MyPayments from  '../view/my/myWallet/myPayments'
import MyBankCard from  '../view/my/myWallet/myBankCard'
import MyCash from '../view/my/myWallet/myCash'
import MyCashSuccess from '../view/my/myWallet/myCashSuccess'
import MyCoupon from  '../view/my/myWallet/myCoupon'
import MyCashCoupon from  '../view/my/myWallet/myCashCoupon'
import MyBankAdd from '../view/my/myWallet/myBankAdd'
import ShoppingCart from  '../view/shoppingCart/shoppingCart'

class Roots extends Component{
    render(){
        return(
            <div>{this.props.children}</div>
        )
    }
}

const RouteConfig = (
    <Router history={hashHistory}>
        <Route path="/" component={Roots}>
            <IndexRoute component={Home}/>+
            <Route path="/details" component={Details}/>
            /*我的*/
            <Route path="/my">
                <IndexRoute component={My}/>

                /*账号管理*/
                <Route path="/my/account" component={MyAccount}/>
                <Route path="/my/shoppingAddress" component={ShoppingAddress}/>
                <Route path="/my/addAddress" component={AddAddress}/>
                <Route path="/my/editAddress" component={EditAddress}/>
                /*关注商户*/
                <Route path="/my/concern" component={MyConcern}/>
                /*我的收藏*/
                <Route path="/my/collect" component={MyCollect}/>
                /*我的订单*/
                <Route path="/my/order" component={MyOrder}/>
                <Route path="/my/detail" component={OrderDetail}/>
                /*我的钱包*/
                <Route path="/my/wallet" component={MyWallet}/>  /*查看更多*/
                <Route path="/my/payments" component={MyPayments}/> /*收支管理*/
                <Route path="/my/bankCard" component={MyBankCard}/> /*银行卡列表*/
                <Route path="/my/bankAdd" component={MyBankAdd}/>
                <Route path="/my/cash" component={MyCash}/> /*提现*/
                <Route path="/my/cashSuccess" component={MyCashSuccess}/> /*提现成功*/
                <Route path="/my/coupon" component={MyCoupon}/> /*优惠券*/
                <Route path="/my/cashCoupon" component={MyCashCoupon}/> /*现金券*/
            </Route>
            /*购物车*/
            <Route path="/shoppingCart" component={ShoppingCart}/>
        </Route>
    </Router>
);

export default RouteConfig